﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SharpRedisDesktopManager.Core.ViewModels
{
    public class EditConnectionViewModel : BaseViewModel
    {
        /// <summary>
        /// 标识配置文件的主键
        /// </summary>
        public int Id { get; set; }

        #region Basic
        private string host { get; set; }
        private string port { get; set; }
        private string auth { get; set; }
        private string name { get; set; }
        private string separator { get; set; }
        private bool enableSSHTunnel { get; set; }
        private bool enableSSL { get; set; }
        private bool isCluster { get; set; }
        #endregion

        #region SSH Tunnel
        private string ssh_Host { get; set; }
        private string ssh_Port { get; set; }
        private string ssh_UserName { get; set; }
        private string ssh_Password { get; set; }
        private string ssh_PrivateKeyFilePath { get; set; }
        private string ssh_Passphrase { get; set; }
        private int ssh_Timeout { get; set; }
        #endregion

        #region SSL
        private string ssl_PrivateKeyFilePath { get; set; }
        private string ssl_PublicKeyFilePath { get; set; }
        private string ssl_AuthorityFilePath { get; set; }
        #endregion

        #region Public

        #region Basic
        public string Host
        {
            get { return host; }
            set
            {
                if (host == value) return;
                host = value;
                NotifyPropertyChanged();
            }
        }
        public string Port
        {
            get { return port; }
            set
            {
                if (port == value) return;
                port = value;
                NotifyPropertyChanged();
            }
        }
        public string Auth
        {
            get { return auth; }
            set
            {
                if (auth == value) return;
                auth = value;
                NotifyPropertyChanged();
            }
        }
        public string Name
        {
            get { return name; }
            set
            {
                if (name == value) return;
                name = value;
                NotifyPropertyChanged();
            }
        }
        public string Separator
        {
            get { return separator; }
            set
            {
                if (separator == value) return;
                separator = value;
                NotifyPropertyChanged();
            }
        }
        public bool EnableSSHTunnel
        {
            get { return enableSSHTunnel; }
            set
            {
                if (enableSSHTunnel == value) return;
                enableSSHTunnel = value;
                NotifyPropertyChanged();
            }
        }
        public bool EnableSSL
        {
            get { return enableSSL; }
            set
            {
                if (enableSSL == value) return;
                enableSSL = value;
                NotifyPropertyChanged();
            }
        }
        public bool IsCluster
        {
            get { return isCluster; }
            set
            {
                if (isCluster == value) return;
                isCluster = value;
                NotifyPropertyChanged();
            }
        }
        #endregion

        #region SSH Tunnel
        public string SSH_Host
        {
            get { return ssh_Host; }
            set
            {
                if (ssh_Host == value) return;
                ssh_Host = value;
                NotifyPropertyChanged();
            }
        }
        public string SSH_Port
        {
            get { return ssh_Port; }
            set
            {
                if (ssh_Port == value) return;
                ssh_Port = value;
                NotifyPropertyChanged();
            }
        }
        public string SSH_UserName
        {
            get { return ssh_UserName; }
            set
            {
                if (ssh_UserName == value) return;
                ssh_UserName = value;
                NotifyPropertyChanged();
            }
        }
        public string SSH_Password
        {
            get { return ssh_Password; }
            set
            {
                if (ssh_Password == value) return;
                ssh_Password = value;
                NotifyPropertyChanged();
            }
        }
        public string SSH_PrivateKeyFilePath
        {
            get { return SSH_PrivateKeyFilePath; }
            set
            {
                if (ssh_PrivateKeyFilePath == value) return;
                ssh_PrivateKeyFilePath = value;
                NotifyPropertyChanged();
            }
        }
        public string SSH_Passphrase
        {
            get { return ssh_Passphrase; }
            set
            {
                if (ssh_Passphrase == value) return;
                ssh_Passphrase = value;
                NotifyPropertyChanged();
            }
        }
        public int SSH_Timeout
        {
            get { return ssh_Timeout; }
            set
            {
                if (ssh_Timeout == value) return;
                ssh_Timeout = value;
                NotifyPropertyChanged();
            }
        }
        #endregion

        #region SSL
        public string SSL_PrivateKeyFilePath
        {
            get { return ssl_PrivateKeyFilePath; }
            set
            {
                if (ssl_PrivateKeyFilePath == value) return;
                ssl_PrivateKeyFilePath = value;
                NotifyPropertyChanged();
            }
        }
        public string SSL_PublicKeyFilePath
        {
            get { return ssl_PublicKeyFilePath; }
            set
            {
                if (ssl_PublicKeyFilePath == value) return;
                ssl_PublicKeyFilePath = value;
                NotifyPropertyChanged();
            }
        }
        public string SSL_AuthorityFilePath
        {
            get { return ssl_AuthorityFilePath; }
            set
            {
                if (ssl_AuthorityFilePath == value) return;
                ssl_AuthorityFilePath = value;
                NotifyPropertyChanged();
            }
        }
        #endregion
        
        #endregion

    }
}
